
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <script src="https://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div class="div"></div>
<button class="btn">点我</button>
<script>
    $(function(){
        $(".btn").click(function(){
            $.ajax({
                url:"http://localhost:8081/springmvc/stuList",
                type:"post",
                data:{
                    "msg":"hello world",
                    "info":"Friday"
                },
                success:function(data){
                    for(var i=0;i<data.length;i++){
                        $(".div").append("<p>姓名:"+data[i].name+",年龄:"+data[i].age+",性别:"+data[i].gender+"</p>");

                    }
                }
            })

        })
    })

</script>
</body>
</html>
